<%@ page import="com.site.pojo.Employee" %><%--
  Created by IntelliJ IDEA.
  User: 86199
  Date: 2021/12/1
  Time: 9:27
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>头部</title>
</head>
<body>
    <script>
        function clearUser() {
            $.ajax({
                "type":"post",
                "url":"/master.do",
                "data":{"opr":"clearuser"},
                "dataType":"json",
                "success":function(data){
                    alert(data)
                    if (data==true){
                        window.location.href = "/login.jsp";
                    }
                }
            });
        }
    </script>>
    <div id="head">
        <div class="left">
            <%
                Employee employee = (Employee) session.getAttribute("employee");
//                if (employee==null){
//                    request.getRequestDispatcher("/login.jsp");
//                }
            %>
            <a href="#" class="button profile"><img src="img/icons/top/huser.png" alt="" /></a>
            Hi,
            <a href="#">
                <%=
                    employee.getEname()
                %>
            </a>
            |
            <a onclick="clearUser();" style="cursor:pointer;">
                注销
            </a>
        </div>
    </div>
</body>
</html>
